/*
 * @Author: your name
 * @Date: 2020-05-14 11:17:41
 * @LastEditTime: 2020-05-18 16:59:34
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \eduweb\src\api\sysMgt\flowTypeMgt.js
 */
import fetch from 'common/src/utils/fetch';
const BASE_URL = '/api/workflow/wfType'

import { findTeacherInfoListInGroupId, findDept } from 'common/src/api/user.js'

// 查询模板类型列表
export function queryWfTypeList(data) {
    return fetch({
        url: `${BASE_URL}/queryWfTypeList`,
        method: 'POST',
        data: data
    })
}

// 新增模板类型
export function addWfType(data) {
    return fetch({
        url: `${BASE_URL}/addWfType`,
        method: 'POST',
        data: data
    })
}

// 更新模板类型
export function updateWfType(data) {
    return fetch({
        url: `${BASE_URL}/updateWfType`,
        method: 'PUT',
        data: data
    })
}

// 删除模板类型
export function deleteWfTypeById(data) {
    return fetch({
        url: `${BASE_URL}/deleteWfTypeById?id=${data}`,
        method: 'DELETE'
    })
}

// 模板审批设置
// 审批列表查询
export function queryWfTypeApproverList(data) {
    return fetch({
        url: `${BASE_URL}/queryWfTypeApproverList`,
        method: 'POST',
        data: data
    })
}
// 新增审批
export function addWfTypeApprover(data) {
    return fetch({
        url: `${BASE_URL}/addWfTypeApprover`,
        method: 'POST',
        data: data
    })
}
// 更新审批
export function updateWfTypeApprover(data) {
    return fetch({
        url: `${BASE_URL}/updateWfTypeApprover`,
        method: 'PUT',
        data: data
    })
}
// 删除审批
export function deleteWfTypeApproverById(data) {
    return fetch({
        url: `${BASE_URL}/deleteWfTypeApproverById?id=${data}`,
        method: 'DELETE'
    })
}

export {
    // 查询审批人
    findTeacherInfoListInGroupId,
    // 查询审批部门
    findDept
}